<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePapersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('papers', function (Blueprint $table) {
            $table->increments('id');
            $table->timestamps();
	    $table->integer('student_id')->unsigned();
	    $table->foreign('student_id')->references('id')->on('students');
   	    $table->string('paper');
            $table->boolean('current')->default(true);
            $table->string('comment')->default('');
	    $table->boolean('by_supervisor')->default(false);
	    $table->boolean('is_final')->default(false);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('papers');
    }
}
